package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.DeviceDataPageReqDto;
import com.zzyl.entity.Device;
import com.zzyl.entity.DeviceData;
import com.zzyl.vo.DeviceDataVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DeviceDataMapper {
    int deleteByPrimaryKey(Long id);

    int insert(DeviceData record);

    int insertSelective(DeviceData record);

    DeviceData selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(DeviceData record);

    int updateByPrimaryKey(DeviceData record);

    /**
     * 这是Mybatis Generator拓展插件生成的方法(请勿删除).
     * This method corresponds to the database table device_data
     *
     * @mbg.generated
     * @author hewei
     */
    int batchInsert(@Param("list") List<DeviceData> list);

    @Select("select * from device_data where iot_id = #{iotId} and product_key = #{productKey}")
    Device selectByProductKey(String iotId ,String productKey);

    Page<DeviceDataVo> selectByPage(DeviceDataPageReqDto deviceDataPageReqDto);
}